Skip to content

Conversation

@MarcosNicolau
Copy link
Member

@MarcosNicolau MarcosNicolau commented May 30, 2025

Description

While aggregating many proofs in sp1 we noticed that setting up the prover has quite the overhead (around 400ms). This pr addresses that issue by:

  • Parallelising the verification in the fetching process with rayon.
  • Obtaining the vk once instead of the setting up the client with the program elf every time: for this the proof pre verification was moved to the creation of the struct so that the vk is computed only once and in parallel regarded if the pre-verification is enabled or not.

Other minor things have been added:

  • A pre-verification flag: to skip the verification process in the fetching process
  • Logs for sp1 cuda prover have been filtered to only show up to warn levels.

Results

With a 3090 the following results were observed:

The verification in the fetching process for a batch of 40 proofs takes:

  • Staging: about 1 minute
  • Head: about 20 seconds

Aggregation of 150 proofs in chunks of 128 took:

  • Staging: about 20min.
  • Head: about 6min.

Type of change

Please delete options that are not relevant.

  • New feature
  • Optimization

Checklist

  • “Hotfix” to testnet, everything else to staging
  • Linked to Github Issue
  • This change depends on code or research by an external entity
    • Acknowledgements were updated to give credit
  • Unit tests added
  • This change requires new documentation.
    • Documentation has been added/updated.
  • This change is an Optimization
    • Benchmarks added/run
  • Has a known issue
  • If your PR changes the Operator compatibility (Ex: Upgrade prover versions)
    • This PR adds compatibility for operator for both versions and do not change batcher/docs/examples
    • This PR updates batcher and docs/examples to the newer version. This requires the operator are already updated to be compatible

@MarcosNicolau MarcosNicolau changed the title feat/perf: sp1 verification & aggregation feat/perf: verification & sp1 aggregation May 30, 2025
@MarcosNicolau MarcosNicolau self-assigned this May 30, 2025
@MarcosNicolau MarcosNicolau changed the title feat/perf: verification & sp1 aggregation feat/perf(aggregation-mode): verification & sp1 aggregation May 30, 2025
Copy link
Contributor

@MauroToscano MauroToscano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the flag, and always pre verify, it has no cost and may avoid issues

@MauroToscano MauroToscano added this pull request to the merge queue Jun 3, 2025
Merged via the queue into staging with commit c7b139c Jun 3, 2025
3 checks passed
@MauroToscano MauroToscano deleted the perf/sp1-verification branch June 3, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants